﻿<html lang="zh-CN"><head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport">
    <link rel="stylesheet" href="/styles/swiper.min.css">
    <title>最佳女王瑜伽培训</title>
    <style>
        body{background-color:#000;}
        .swiper-pagination-bullet {
            width: 8px;
            height: 8px;
            display: inline-block;
            border-radius: 100%;
            background: #ffffff;
            opacity: .2;
        }

        .swiper-pagination-bullet-active {
            opacity: 1;
            background: #f1f2f3;
        }

        .swiper-button-next, .swiper-button-prev {
    position: absolute;
    top: 50%;
    width: 27px;
    height: 44px;
    margin-top: -22px;
    margin-right: -15px;
    z-index: 10;
    cursor: pointer;
    -moz-background-size: 27px 44px;
    -webkit-background-size: 27px 44px;
    background-size: 10px 18px;
    background-position: center;
    background-repeat: no-repeat;
}
        .swiper-button-prev{
            margin-left:-15px;
        }

        .swiper-loading {
            background-color:#000;
            background-image: url(../images/loadForShowImg.gif);
            background-repeat: no-repeat;
            background-position: center;
        }
        #Nav{background-color:#000;}
        .navSlider{color:#fff;font-size:14px;line-height:34px;text-align:center;border-right:0px solid #262626;}
        .navSlider a{display:inline-block;text-decoration:none;color:#fff;}

        .footer{display:none;}
        .navTable{width:100%;}
        .navTable td{width:33.33%;}
        .navTable td a {
            display: inline-block;
            width: 100%;
            color: #585858;
            text-decoration: none;
            border-radius: 3px;
            text-align:center;
        }     
    </style>
</head>

<body style="padding: 0px; margin: 0px;">

    <div class="loading" style="background-color: rgba(255, 255, 255, 0.8); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; background-image: url(&quot;&quot;); background-position: center center; background-repeat: no-repeat; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-size: 50px;"></div>

    <div id="content" >
        <div id="Nav">
            <div class="swiper-container swiper-container-Nav">
                <div class="swiper-wrapper swiper-wrapper-Nav">
                   
                 </div>
                <div class="swiper-button-prev"></div>
                <div class="swiper-button-next"></div>
            </div>
        </div>

        <div id="swiper">
        <div class="swiper-container swiper-container-Img">
            <div class="swiper-wrapper swiper-wrapper-Img">
                
            </div>
            <div class="swiper-pagination"></div>
            <div class="swiper-scrollbar"></div>
        </div>
       </div>

        <div id="indexConent" >

        </div>
        <div class="footer">
            <table class="navTable">
                <tr>
                    <td style="text-align:left;border-right:0px dotted #666;"><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&amp;uin=1213382796&amp;site=qq&amp;menu=yes"><img src="../images/qqlogo.png" style="width:38px;" /></a></td>
                    <td style="text-align:center;border-right:0px dotted #666;"><a target="_blank" href="ContentInfo?id=0"><img src="../images/wechartLogo.png" style="width:25px;" /></a></td>
                    <td style="text-align:right;"><a target="_blank" href="tel:18611171241"><img src="../images/phoneLogo.png" style="width:25px;" /></a></td>
                </tr>
                <tr>
                    <td colspan="3" style="text-align:center;"><div style="margin:0px 8px;border-top:1px solid #333;padding:5px 0px;color:#fff;text-align:center;font-size:12px;">最佳女王瑜伽培训 版权所有</div></td>
                </tr>
            </table>
        </div>
    </div>
    <script src="/js/lib/jquery.js"></script>
    <script src="/js/lib/swiper.min.js"></script>
    <script>
         
        function getSiteBg() {
            var Jsondata = {};
            Jsondata.type = "手机端配置";
            Jsondata.pageIndex = 1;
            Jsondata.pageSize = 1000;
            $.post("/admin/getnewsListByType", JSON.stringify(Jsondata), function (response) {
                var templateUrl = ' <div class="swiper-slide swiper-loading"><a href="{{url}}" target="_blank"><img src="../files/upload/{{imageName}}" style="width:100%;" /></a></div>';
                var template = ' <div class="swiper-slide swiper-loading"><img src="../files/upload/{{imageName}}" style="width:100%;" /></div>';
                var templateNav = '<div class="swiper-slide navSlider"><a href="{{url}}" target="_blank">{{title}}</a></div>';
                var templateCTURL = '<div class="swiper-loading" style="border-top:5px solid #000;min-height:50px;" ><a href="{{url}}" target="_blank"><img src="../files/upload/{{imageName}}" style="width:100%;" /></a></div>';
                var templateCT = '<div class="swiper-loading"  style="border-top:5px solid #000;min-height:50px;"><img src="../files/upload/{{imageName}}" style="width:100%;" onclick="return false;" /></div>';
                var temphtml = "";
                var index = 0;

                var navHTML="";
                navHTML += '<div class="swiper-slide navSlider"><a href="news" target="_blank">新闻动态</a></div>';
                navHTML += '<div class="swiper-slide navSlider"><a href="product" target="_blank">训练照片</a></div>';

                var CtHtml = "";
                for (i = 0; i < response.length; i++) {
                    var o = response[i];
                    if (o.title.indexOf('(手机端背景图片)')>=0) {
                        var temp = template;
                        if (o.IsUrl != null && o.IsUrl != undefined && o.IsUrl) temp = templateUrl;
                        temp = temp.replace("{{imageName}}", o.newImg).replace("{{url}}", "ContentInfo?id=" + o._id);;
                        temphtml += temp;
                    }
                    else if (o.title.indexOf("(首页背景)") >= 0) {
                        var temp = templateCT;
                        if (o.IsUrl != null && o.IsUrl != undefined && o.IsUrl) temp = templateCTURL;
                        temp = temp.replace("{{imageName}}", o.newImg).replace("{{url}}", "ContentInfo?id=" + o._id);                      
                        CtHtml += temp;
                    }
                    else{
                        var newTemp=templateNav;
                        newTemp=newTemp.replace("{{title}}",o.title);
                        newTemp=newTemp.replace("{{url}}","ContentInfo?id="+o._id);
                        navHTML+=newTemp;
                    }
                }
                //swiper nav               
                $(".swiper-wrapper-Nav").html(navHTML);
                var NavSwiper = new Swiper('.swiper-container-Nav', {
                    initialSlide:0,
                    slidesPerView: 4,
                    freeMode: true,
                    freeModeMomentum: false,
                    prevButton: '.swiper-button-prev',
                    nextButton: '.swiper-button-next',
                });
                $(".swiper-container-Nav").css("height", "34px");

                //swiper img
                $(".swiper-wrapper-Img").html(temphtml);                
                var ht = $(window).height();     
                var mySwiper = new Swiper('.swiper-container-Img', {
                autoplay: 3000,
                initialSlide:0,
                autoplayDisableOnInteraction:false,        
                //pagination: '.swiper-pagination',
                scrollbar: '.swiper-scrollbar',
                scrollbarHide: false,
                });
                $(".swiper-container-Img").css("height", $(window).width().toString() + "px");

                //set content
                $("#indexConent").html(CtHtml);

                setTimeout(function () {                   
                    $(".loading").hide();
                    $(".footer").fadeIn(3000);
                }, 1000);

                             
                
                
            });
        }
        
        $(function () {                  
            getSiteBg();
        });

    </script>


</body></html>